package bookticket.crm.login.servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class LoginServlet extends HttpServlet {  
    private static final long serialVersionUID = 1L;  
  
    public LoginServlet() {  
        super();  
    }  
  
    public void doGet(HttpServletRequest request, HttpServletResponse response)  
            throws ServletException, IOException {  
        this.doPost(request, response);  
    }  
  
    public void doPost(HttpServletRequest request, HttpServletResponse response)  
            throws ServletException, IOException {  
        response.setCharacterEncoding("UTF-8");  
        PrintWriter out = response.getWriter();  
        String name = request.getParameter("username");  
        String pass = request.getParameter("password");  
        String message = "";  
        if ("njy".equals(name) & "njy".equals(pass)) {  
            message = "登陆成功!";  
        } else {  
            message = "用户名或密码有误!";  
        }  
    }  
}  